//
//  ViewController.m
//  29_TransitionAnimation
//
//  Created by 徐康 on 16/8/23.
//  Copyright © 2016年 KX. All rights reserved.
//
#import "PopTransitionAnimation.h"
#import "ViewController.h"
#import "PushTransitonAnimation.h"
@interface ViewController ()<UINavigationControllerDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.navigationController.delegate = self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (nullable id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                            animationControllerForOperation:(UINavigationControllerOperation)operation
                                                         fromViewController:(UIViewController *)fromVC
                                                           toViewController:(UIViewController *)toVC{
//    id <UIViewControllerAnimatedTransitioning>
    
    if (operation == UINavigationControllerOperationPush) {
        PushTransitonAnimation *pushh = [[PushTransitonAnimation alloc]init];
        return pushh;
        
    }else if (operation == UINavigationControllerOperationPop){
        PopTransitionAnimation *popp = [[PopTransitionAnimation alloc]init];
        return popp;
    }else{
        
    }
    return nil;
    
}
@end
